#include <iostream>
#include <stack>
using namespace std;

//  97.46 %
class MinStack
{
  public:
	/** initialize your data structure here. */
	MinStack() {}

	void push(int x)
	{
		s1.push(x);
		if (s2.empty() || x <= s2.top())
			s2.push(x);
	}

	void pop()
	{
		if (s1.top() == s2.top())
			s2.pop();
		s1.pop();
	}

	int top()
	{
		return s1.top();
	}

	int getMin()
	{
		return s2.top();
	}

  private:
	stack<int> s1, s2;
};

int main()
{
	MinStack *minStack = new MinStack();
	minStack->push(-2);
	minStack->push(0);
	minStack->push(-3);
	minStack->getMin();
	minStack->pop();
	minStack->top();
	minStack->getMin();
	return 0;
}
